import Cookies from 'js-cookie'

const TokenKey = 'Admin-Token'

const JWT = 'token'
const UserId = 'tokenUserId'

// 将信息保存到Cookies
// jwt
export function getJWT() {
  return Cookies.get(JWT)
}

export function setJWT(jwt) {
  return Cookies.set(JWT, jwt)
}

export function removeJWT() {
  return Cookies.remove(JWT)
}

// UserId
export function getUserId() {
  return Cookies.get(UserId)
}

export function setUserId(userid) {
  return Cookies.set(UserId, userid)
}

export function removeUserId() {
  return Cookies.remove(UserId)
}

// stateToken
export function getToken() {
  return Cookies.get(TokenKey)
}

export function setToken(token) {
  return Cookies.set(TokenKey, token)
}

export function removeToken() {
  return Cookies.remove(TokenKey)
}
